﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;
using System.Data;
using Microsoft.Synchronization;
using Microsoft.Synchronization.Data;

namespace Infrastructure.WpfClient.Accessibility
{
    [ServiceContract(SessionMode = SessionMode.Required)]
    [ServiceKnownType(typeof(SyncIdFormatGroup))]
    [ServiceKnownType(typeof(DbSyncContext))]
    [ServiceKnownType(typeof(SyncSchema))]
    [ServiceKnownType(typeof(WebSyncFaultException))]    
    public interface IRelationalSyncContract
    {
        [OperationContract]
        void BeginSession(SyncProviderPosition position, SyncSessionContext syncSessionContext);

        [OperationContract]
        void EndSession(SyncSessionContext syncSessionContext);

        [OperationContract]
        ChangeBatch GetChangeBatch(uint batchSize, SyncKnowledge destinationKnowledge, out object changeDataRetriever);

        [OperationContract]
        FullEnumerationChangeBatch GetFullEnumerationChangeBatch(uint batchSize, SyncId lowerEnumerationBound, SyncKnowledge knowledgeForDataRetrieval, out object changeDataRetriever);

        [OperationContract]
        void GetSyncBatchParameters(out uint batchSize, out SyncKnowledge knowledge);

        [OperationContract]
        SyncIdFormatGroup GetIdFormats();

        [OperationContract]
        void ProcessChangeBatch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, object changeDataRetriever, SyncCallbacks syncCallbacks, SyncSessionStatistics sessionStatistics);

        [OperationContract]
        void ProcessFullEnumerationChangeBatch(ConflictResolutionPolicy resolutionPolicy, FullEnumerationChangeBatch sourceChanges, object changeDataRetriever, SyncCallbacks syncCallbacks, SyncSessionStatistics sessionStatistics);        
    }   
}
